using UnityEngine;
using System.Collections;


public class McBruiser : Character {
	public string m_strName = "McBruiser";

	//Base stats
	#region Basic stats declaration
	private int m_nStrength = 33;
	private int m_nAgi = 33;
	private int m_nInt = 15;
	private int m_nLck = 1;
	private int m_nLevel = 1;
	private int m_nAP = 100;
	#endregion
	//Stat increase
	#region Char specific stat increase per lvl
	private int m_nStrInc = 4;
	private int m_nAgiInc = 4;
	private int m_nIntInc = 2;
	private int m_nLckInc = 0;
	#endregion
	#region Base stat growth per lvl
	private int m_nStrGrowth = 6;
	private int m_nAgiGrowth = 6;
	private int m_nIntGrowth = 3;
	private int m_nLckGrowth = 0;
	#endregion
	//Battle stats
	#region BattleStats stats
	private int m_nDmgReduction;
//	private int m_nHealth;
	private int m_nAPRegen;
	private int m_nIncDOT;
	private int m_nIncDMG;
	#endregion
	//Skills
	#region Skills
	public enum Skills{
		LIGHTNING_JAB,
		COUNTER_PUNCH,
		TAKE_A_BREATHER,
		HAYMAKER
	};
	public Skills enumSkill1;
	public Skills enumSkill2;
	public Skills enumSkill3;
	public Skills enumSkill4;
	
	public ArrayList aSkills = new ArrayList();
	
	#endregion
	//Lvl up
	#region Function LvlUp
	public void LvlUp()
	{
		m_nLevel += 1;	
		//assign stats based on lvl
		m_nStrength = m_nStrength + (m_nLevel - 1) * m_nStrInc + (m_nLevel - 1) * m_nStrGrowth;
		m_nAgi = m_nAgi + (m_nLevel - 1) * m_nAgiInc + (m_nLevel - 1) * m_nAgiGrowth;
		m_nInt = m_nInt + (m_nLevel - 1) * m_nIntInc + (m_nLevel - 1) * m_nIntGrowth;
		m_nLck = m_nLck + (m_nLevel - 1) * m_nLckInc + (m_nLevel - 1) * m_nLckGrowth;
		
		print (m_nStrength);
		print (m_nAgi);
		print (m_nInt);
		print (m_nLck);
	}
	#endregion
		
	#region Override abstract Character functions
	public override int GetAgi(){
		return m_nAgi;
	}
	public override void RegenAP(){
		m_nAP = m_nAP + m_nAPRegen;
	}
	public override void TakeDMG(int p_nDMG){
		//Dmg reduction
		m_nHealth -= p_nDMG;
	}
	public override string GetName ()
	{
		return(m_strName);
	}
	protected override void DealDMG(int p_nDMG){
		
	}
	protected override void DealDOT(int p_nDOT){
		
	}
	protected override void Heal(int p_nHeal){
		
	}
	protected override void HOT(int p_nHOT){
		
	}
	#endregion
	
	#region Character skills
	public void LIGHTNING_JAB(){
		Debug.Log("LIGHTNING_JAB");
		//Deals 100 + (20 per level) + (50% of STR) of damage to the enemy.
		//After end of attack animation deal damage
		
	}
	public void COUNTER_PUNCH(){
		Debug.Log("COUNTER_PUNCH");
		//Deals 50 + (10 per level) + (50% of STR) of damage. Additionally, 
		//the attack poisons the enemy, causing 10 + (10 per level) + (10% of STR) 
		//of damage for 4 turns.
		
	}
	public void TAKE_A_BREATHER(){
		Debug.Log("TAKE_A_BREATHER");
		//Deals 200 + (40 per level) + (70% of STR) of damage to the enemy.
		//If enemy is hit, gain 10 AP.
	}
	public void HAYMAKER(){
		Debug.Log("HAYMAKER");
		
	}
	#endregion
	
	void Awake () {
		#region assign skills to delegates
		aSkills.Add(enumSkill1);
		aSkills.Add(enumSkill2);
		aSkills.Add(enumSkill3);
		aSkills.Add(enumSkill4);
		
		for (int x = 0; x < aSkills.Count; x++){
			
			switch (aSkills[x].ToString()){
				case "LIGHTNING_JAB":
					switch(x){
						case 0:
							dSkill1 += LIGHTNING_JAB;
						break;
						case 1:
							dSkill2 += LIGHTNING_JAB;
						break;
						case 2:
							dSkill3 += LIGHTNING_JAB;
						break;
						case 3:
					 		dSkill4 += LIGHTNING_JAB;
						break;
					}
				break;
				case "COUNTER_PUNCH":
					switch(x){
						case 0:
							dSkill1 += COUNTER_PUNCH;
						break;
						case 1:
							dSkill2 += COUNTER_PUNCH;
						break;
						case 2:
							dSkill3 += COUNTER_PUNCH;
						break;
						case 3:
					 		dSkill4 += COUNTER_PUNCH;
						break;
					}
				break;
				case "TAKE_A_BREATHER":
					switch(x){
						case 0:
							dSkill1 += TAKE_A_BREATHER;
						break;
						case 1:
							dSkill2 += TAKE_A_BREATHER;
						break;
						case 2:
							dSkill3 += TAKE_A_BREATHER;
						break;
						case 3:
					 		dSkill4 += TAKE_A_BREATHER;
						break;
					}
				break;
				case "HAYMAKER":
					switch(x){
						case 0:
							dSkill1 += HAYMAKER;
						break;
						case 1:
							dSkill2 += HAYMAKER;
						break;
						case 2:
							dSkill3 += HAYMAKER;
						break;
						case 3:
					 		dSkill4 += HAYMAKER;
						break;
					}
				break;
					
			}
		}
//		dSkill1 += enumSkill1;
//		dSkill2 += enumSkill2;
//		dSkill3 += enumSkill3;
//		dSkill4 += enumSkill4;
		
		#endregion
//		Debug.Log("Skills");
//		for (int x=0; x < aSkills.Count; x++){
//			Debug.Log(aSkills[x].ToString());	
//		}
	}
	// Use this for initialization
	void Start () {
		dSkill1();
		dSkill2();
		dSkill3();
		dSkill4();

		#region Get Papa Bear lvl
		//get lvl here
		
		//assign stats based on lvl
		m_nStrength = m_nStrength + (m_nLevel - 1) * m_nStrInc + (m_nLevel - 1) * m_nStrGrowth;
		m_nAgi = m_nAgi + (m_nLevel - 1) * m_nAgiInc + (m_nLevel - 1) * m_nAgiGrowth;
		m_nInt = m_nInt + (m_nLevel - 1) * m_nIntInc + (m_nLevel - 1) * m_nIntGrowth;
		m_nLck = m_nLck + (m_nLevel - 1) * m_nLckInc + (m_nLevel - 1) * m_nLckGrowth;
		print (m_nStrength);
		print (m_nAgi);
		print (m_nInt);
		print (m_nLck);
		
		#endregion
		#region Initialize computed stats
		m_nHealth = 300 + (m_nStrength * m_nHealthModifier);
		m_nAPRegen = 10 + (m_nInt / m_nAPRegenModifier);
		print ("Health " + m_nHealth);
		print ("AP Regen per turn " + m_nAPRegen);
		
		#endregion
	}
	// Update is called once per frame
	void Update () {
		print (m_strName + " hp " + m_nHealth);
//		if (bTurn == true){
//			print(m_strName + "'s turn"); 
//			BattleManager.Instance.DealDMG(200,m_strName);
//			BattleManager.Instance.EndTurn();
//			
//		}
	}
}
